package com.fin.zw.intelligentbot.entity;

import com.fin.zw.intelligentbot.enums.CorpusType;
import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(appliesTo = "corpus_info", comment = "语料信息")
@Data
public class CorpusInfo extends BaseEntity {

    @Column(columnDefinition = "text comment '语音文本'")
    private String content;

    @Column(columnDefinition = "varchar(200) comment '语音文件路径'")
    private String file;

    @Column(columnDefinition = "varchar(100) comment '名称'")
    private String name;

    @Column(columnDefinition = "varchar(20) comment '类型'")
    @Enumerated(EnumType.STRING)
    private CorpusType type;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sce_id", columnDefinition = "varchar(64) COMMENT '场景id'")
    private SceneInfo sceneInfo;

    @ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "company_id", columnDefinition = "varchar(64) COMMENT '企业id'")
    private Company company;

    @Column(columnDefinition = "datetime COMMENT '创建时间'")
    private Date createTime;

    @Column(columnDefinition = "varchar(100) comment '创建人id'")
    private String userId;

    @Column(columnDefinition = "varchar(100) comment '名称'")
    private String userName;
}
